<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% target_tcp_proxy = grab_attributes(pwd)['target_tcp_proxy'] -%>
describe google_compute_target_tcp_proxy(project: <%= doc_generation ? "#{gcp_project_id}" : "gcp_project_id" -%>, name: <%= doc_generation ? "'#{target_tcp_proxy['name']}'" : "target_tcp_proxy['name']" -%>) do
  it { should exist }
  its('proxy_header') { should eq <%= doc_generation ? "'#{target_tcp_proxy['proxy_header']}'" : "target_tcp_proxy['proxy_header']" -%> }
  its('service') { should  match /\/<%= "#{grab_attributes(pwd)['target_tcp_proxy']['tcp_backend_service_name']}" -%>$/ }
end

describe google_compute_target_tcp_proxy(project: <%= doc_generation ? "#{gcp_project_id}" : "gcp_project_id" -%>, name: 'nonexistent') do
  it { should_not exist }
end